﻿<%@ Page Language="C#" MasterPageFile="~/POS.master" AutoEventWireup="true" CodeFile="SearchItems.aspx.cs" Inherits="Items_SearchItems" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="Server">
    <div class="container">
        <div class="form-horizontal" id="divCustomerWrapper">
            <div class="form-group">
                <label class="control-label col-sm-2" for="Person">Category :</label>
                <div class="col-sm-3">
                    <asp:DropDownList ID="DDL_Category" AutoPostBack="true" OnSelectedIndexChanged="DDL_Category_SelectedIndexChanged" DataTextField="CategoryName" DataValueField="CategoryId" CssClass="form-control" runat="server"></asp:DropDownList>
                </div>
                <label class="control-label col-sm-2" for="Person">Sub Category :</label>
                <div class="col-sm-3">
                    <asp:DropDownList ID="DDL_SubCategory" DataTextField="SubCategoryName" DataValueField="SubCategoryId" CssClass="form-control" runat="server"></asp:DropDownList>
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-sm-2" for="Name">Item Name :</label>
                <div class="col-sm-3">
                    <asp:TextBox runat="server" ID="txtItemName" CssClass="form-control" placeholder="Item Name" />
                </div>
                <label class="control-label col-sm-2" for="Name"></label>
                <div class="col-sm-3">

                    <asp:Button runat="server" ID="btnSearch" CssClass="btn btn-success" Text="Search" OnClick="btnSearch_Click" />
                </div>
            </div>
        </div>
        <div class="col-sm-11">
            <asp:GridView runat="server" ID="gvItems" CssClass="grid" AutoGenerateColumns="false" AllowPaging="true" PageSize="10" AlternatingRowStyle-BackColor="Wheat">
                <Columns>
                    <asp:TemplateField HeaderText="Sr.#">
                        <ItemTemplate>
                            <%#Container.DataItemIndex+1 %>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Bar Code">
                        <ItemTemplate>
                            <asp:Label Text='<%#Bind("barCode") %>' ID="lblBarCode" runat="server" />
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Name">
                        <ItemTemplate>
                            <asp:Label Text='<%#Bind("ItemName") %>' ID="lblItemName" runat="server" />
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Description">
                        <ItemTemplate>
                            <asp:Label Text='<%#Bind("Description") %>' ID="Label2" runat="server" />
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Manufacturer">
                        <ItemTemplate>
                            <asp:Label Text='<%#Bind("Manufacturer") %>' ID="lblManufacturer" runat="server" />
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Sale Price">
                        <ItemTemplate>
                            <asp:Label Text='<%#Bind("salePrice") %>' ID="lblSalePrice" runat="server" />
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Discount">
                        <ItemTemplate>
                            <asp:Label Text='<%#Bind("Discount") %>' ID="lblDiscount" runat="server" />
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:HyperLinkField DataNavigateUrlFormatString="~/Items/AddEditItems.aspx?id={0}" DataNavigateUrlFields="ItemId" Target="_blank" Text="Edit" HeaderText="Edit" />
                    <asp:TemplateField HeaderText="Delete">
                        <ItemTemplate>
                            <asp:LinkButton Text="Delete" ID="lbtnDelete" OnClick="lbtnDelete_Click" CommandArgument='<%#Bind("ItemId") %>' runat="server" />
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
            </asp:GridView>
        </div>
    </div>
</asp:Content>

